<html>
<head>
  <meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=ISO-8859-1">
  <title>sigmoid.m</title>
<link rel="stylesheet" type="text/css" href="../../m-syntax.css">
</head>
<body>
<code>
<span class=defun_kw>function</span>&nbsp;<span class=defun_out>y</span>=<span class=defun_name>sigmoid</span>(<span class=defun_in>X,arg1,arg2</span>)<br>
<span class=h1>%&nbsp;SIGMOID&nbsp;Evaluates&nbsp;sigmoid&nbsp;function.</span><br>
<span class=help>%</span><br>
<span class=help>%&nbsp;<span class=help_field>Synopsis:</span></span><br>
<span class=help>%&nbsp;&nbsp;y&nbsp;=&nbsp;sigmoid(X,model)</span><br>
<span class=help>%&nbsp;&nbsp;y&nbsp;=&nbsp;sigmois(X,A1,A2)</span><br>
<span class=help>%</span><br>
<span class=help>%&nbsp;<span class=help_field>Description:</span></span><br>
<span class=help>%&nbsp;&nbsp;y&nbsp;=&nbsp;sigmoid(X,model)&nbsp;returns&nbsp;</span><br>
<span class=help>%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y&nbsp;=&nbsp;1/(1+exp(A(1)*X&nbsp;+&nbsp;A(2))</span><br>
<span class=help>%</span><br>
<span class=help>%&nbsp;&nbsp;where&nbsp;A&nbsp;=&nbsp;model.A.</span><br>
<span class=help>%</span><br>
<span class=help>%&nbsp;&nbsp;y&nbsp;=&nbsp;sigmois(X,&nbsp;A1,&nbsp;A2)&nbsp;allows&nbsp;A&nbsp;to&nbsp;be&nbsp;given&nbsp;as&nbsp;A&nbsp;=&nbsp;[A1&nbsp;A2].</span><br>
<span class=help>%</span><br>
<span class=help>%&nbsp;<span class=help_field>Input:</span></span><br>
<span class=help>%&nbsp;&nbsp;X&nbsp;[1&nbsp;x&nbsp;num_data]&nbsp;Inputs.</span><br>
<span class=help>%&nbsp;&nbsp;model.A&nbsp;[2&nbsp;x&nbsp;1]&nbsp;Sigmoid&nbsp;parameters.</span><br>
<span class=help>%</span><br>
<span class=help>%&nbsp;<span class=help_field>Output:</span></span><br>
<span class=help>%&nbsp;&nbsp;y&nbsp;[1&nbsp;x&nbsp;num_data]&nbsp;Evaluated&nbsp;sigmoid&nbsp;function.</span><br>
<span class=help>%</span><br>
<span class=help>%&nbsp;See&nbsp;also&nbsp;</span><br>
<span class=help>%&nbsp;&nbsp;MLSIGMOID.</span><br>
<span class=help>%</span><br>
<hr>
<span class=help1>%&nbsp;<span class=help1_field>About:</span>&nbsp;Statistical&nbsp;Pattern&nbsp;Recognition&nbsp;Toolbox</span><br>
<span class=help1>%&nbsp;(C)&nbsp;1999-2003,&nbsp;Written&nbsp;by&nbsp;Vojtech&nbsp;Franc&nbsp;and&nbsp;Vaclav&nbsp;Hlavac</span><br>
<span class=help1>%&nbsp;&lt;a&nbsp;href="http://www.cvut.cz"&gt;Czech&nbsp;Technical&nbsp;University&nbsp;Prague&lt;/a&gt;</span><br>
<span class=help1>%&nbsp;&lt;a&nbsp;href="http://www.feld.cvut.cz"&gt;Faculty&nbsp;of&nbsp;Electrical&nbsp;Engineering&lt;/a&gt;</span><br>
<span class=help1>%&nbsp;&lt;a&nbsp;href="http://cmp.felk.cvut.cz"&gt;Center&nbsp;for&nbsp;Machine&nbsp;Perception&lt;/a&gt;</span><br>
<br>
<span class=help1>%&nbsp;<span class=help1_field>Modifications:</span></span><br>
<span class=help1>%&nbsp;3-jun-2004,&nbsp;VF</span><br>
<span class=help1>%&nbsp;8-may-2003,&nbsp;VF</span><br>
<br>
<hr>
<span class=keyword>if</span>&nbsp;<span class=stack>nargin</span>&nbsp;==&nbsp;3,<br>
&nbsp;&nbsp;y&nbsp;=&nbsp;1./(1+exp(X*arg1&nbsp;+&nbsp;arg2));<br>
<span class=keyword>else</span><br>
&nbsp;&nbsp;model=c2s(arg1);<br>
&nbsp;&nbsp;y&nbsp;=&nbsp;1./(1+exp(X*model.A(1)+model.A(2)));<br>
<span class=keyword>end</span><br>
<br>
<span class=jump>return</span>;<br>
<span class=comment>%&nbsp;EOF</span><br>
</code>
